// Copyright (C) ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
//
// $Id: logging.hpp 287 2008-11-27 14:32:14Z heavyzheng $
//

#ifndef ZZHENG_LOGGING_HPP_20080901__
#define ZZHENG_LOGGING_HPP_20080901__

#include <zzheng/logging/config.hpp>
#include <zzheng/logging/common.hpp>
#include <zzheng/logging/log_level.hpp>
#include <zzheng/logging/destination.hpp>
#include <zzheng/logging/console.hpp>
#include <zzheng/logging/rolling_file.hpp>
#include <zzheng/logging/basic_log_factory.hpp>
#include <zzheng/logging/basic_logger.hpp>
#include <zzheng/logging/function_detail.hpp>

////////////////////////////////////////////////////////////////////////////////////////////////////
// underlying logging library includes and namespace alias
//

// Checks the conditional compilation macros. By default, use null implementation.
#if !defined(ZZHENG_LOGGING_USES_NONE) \
 && !defined(ZZHENG_LOGGING_USES_LOG4CPLUS) \
 && !defined(ZZHENG_LOGGING_USES_BOOST_LOG) \
 && !defined(ZZHENG_LOGGING_USES_CUSTOMIZED_LIB)
#  define ZZHENG_LOGGING_USES_NONE
#endif


#if defined(ZZHENG_LOGGING_HAS_NONE) || defined(ZZHENG_LOGGING_USES_NONE)
#  include <zzheng/logging/none.hpp>
#endif // ZZHENG_LOGGING_HAS_NULL_IMPL || ZZHENG_LOGGING_USES_NULL_IMPL

#if defined(ZZHENG_LOGGING_HAS_LOG4CPLUS) || defined(ZZHENG_LOGGING_USES_LOG4CPLUS)
#  include <zzheng/logging/log4cplus.hpp>
#endif // ZZHENG_LOGGING_HAS_LOG4CPLUS || ZZHENG_LOGGING_USES_LOG4CPLUS

#if defined(ZZHENG_LOGGING_HAS_BOOST_LOG) || defined(ZZHENG_LOGGING_USES_BOOST_LOG)
#  include <zzheng/logging/boost_log.hpp>
#endif // ZZHENG_LOGGING_HAS_BOOST_LOG || ZZHENG_LOGGING_USES_BOOST_LOG


#if defined(ZZHENG_LOGGING_USES_NONE)
#  define ZZHENG_LOGGING_IMPL_NS  none_
#elif defined(ZZHENG_LOGGING_USES_LOG4CPLUS)
#  define ZZHENG_LOGGING_IMPL_NS  log4cplus_
#elif defined(ZZHENG_LOGGING_USES_BOOST_LOG)
#  define ZZHENG_LOGGING_IMPL_NS  boost_log_
#endif


////////////////////////////////////////////////////////////////////////////////////////////////////
// typedef's
//

namespace zzheng {
namespace logging {

    typedef basic_log_factory<ZZHENG_LOGGING_IMPL_NS::log_factory>  log_factory;
    typedef basic_logger     <ZZHENG_LOGGING_IMPL_NS::log_factory>  logger;

    inline
    logger get_root_logger() {
        return detail::get_root_logger<ZZHENG_LOGGING_IMPL_NS::log_factory>();
    }

    inline
    logger get_logger(const std::string& name) {
        return detail::get_logger<ZZHENG_LOGGING_IMPL_NS::log_factory>(name);
    }

} // namespace zzheng::logging
} // namespace zzheng


#endif // ZZHENG_LOGGING_HPP_20080901__



